package com.xiweicheng.test.jpa.entity;
// Generated 2018-7-13 22:08:49 by Hibernate Tools 5.0.6.Final

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Groups generated by hbm2java
 */
@Entity
@Table(name = "groups", catalog = "tms")
public class Groups implements java.io.Serializable {

	private Long id;
	private Date createDate;
	private String creator;
	private String groupName;
	private String status;
	private Date updateDate;
	private String updater;
	private Set<GroupMembers> groupMemberses = new HashSet<GroupMembers>(0);
	private Set<GroupAuthorities> groupAuthoritieses = new HashSet<GroupAuthorities>(0);

	public Groups() {
	}

	public Groups(String groupName, String status) {
		this.groupName = groupName;
		this.status = status;
	}

	public Groups(Date createDate, String creator, String groupName, String status, Date updateDate, String updater,
			Set<GroupMembers> groupMemberses, Set<GroupAuthorities> groupAuthoritieses) {
		this.createDate = createDate;
		this.creator = creator;
		this.groupName = groupName;
		this.status = status;
		this.updateDate = updateDate;
		this.updater = updater;
		this.groupMemberses = groupMemberses;
		this.groupAuthoritieses = groupAuthoritieses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_date", length = 19)
	public Date getCreateDate() {
		return this.createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Column(name = "creator")
	public String getCreator() {
		return this.creator;
	}

	public void setCreator(String creator) {
		this.creator = creator;
	}

	@Column(name = "group_name", nullable = false, length = 50)
	public String getGroupName() {
		return this.groupName;
	}

	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}

	@Column(name = "status", nullable = false)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "update_date", length = 19)
	public Date getUpdateDate() {
		return this.updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	@Column(name = "updater")
	public String getUpdater() {
		return this.updater;
	}

	public void setUpdater(String updater) {
		this.updater = updater;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "groups")
	public Set<GroupMembers> getGroupMemberses() {
		return this.groupMemberses;
	}

	public void setGroupMemberses(Set<GroupMembers> groupMemberses) {
		this.groupMemberses = groupMemberses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "groups")
	public Set<GroupAuthorities> getGroupAuthoritieses() {
		return this.groupAuthoritieses;
	}

	public void setGroupAuthoritieses(Set<GroupAuthorities> groupAuthoritieses) {
		this.groupAuthoritieses = groupAuthoritieses;
	}

}
